40f56239bvOjuuuViZ0XMlNiREFC0A linux-2.6.7-xen-sparse/arch/xen/kernel/ctrl_if.c
40f56239pYRq5yshPTkv3ujXKc8K6g linux-2.6.7-xen-sparse/arch/xen/kernel/empty.c
40f56238xFQe9T7M_U_FItM-bZIpLw linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c
+4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6.7-xen-sparse/arch/xen/kernel/fixup.c
40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.7-xen-sparse/arch/xen/kernel/process.c
40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c
3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.7-xen-sparse/arch/xen/kernel/xen_proc.c
jmp error_code
#endif
-ENTRY(spurious_interrupt_bug)
- pushl $0
- pushl $do_spurious_interrupt_bug
+ENTRY(fixup_4gb_segment)
+ pushl $do_fixup_4gb_segment
jmp error_code
.data
HYPERVISOR_vm_assist(VMASST_CMD_enable,
VMASST_TYPE_4gb_segments);
+ HYPERVISOR_vm_assist(VMASST_CMD_enable,
+ VMASST_TYPE_4gb_segments_notify);
#if 0
HYPERVISOR_vm_assist(VMASST_CMD_enable,
VMASST_TYPE_writeable_pagetables);
asmlinkage void coprocessor_error(void);
asmlinkage void simd_coprocessor_error(void);
asmlinkage void alignment_check(void);
-asmlinkage void spurious_interrupt_bug(void);
+asmlinkage void fixup_4gb_segment(void);
asmlinkage void machine_check(void);
static int kstack_depth_to_print = 24;
}
}
-asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs,
- long error_code)
-{
-#if 0
- /* No need to warn about this any longer. */
- printk("Ignoring P6 Local APIC Spurious Interrupt Bug...\n");
-#endif
-}
-
/*
* 'math_state_restore()' saves the current math information in the
* old math state array, and gets the new ones from the current task
{ 12, 0, __KERNEL_CS, (unsigned long)stack_segment },
{ 13, 0, __KERNEL_CS, (unsigned long)general_protection },
{ 14, 0, __KERNEL_CS, (unsigned long)page_fault },
- { 15, 0, __KERNEL_CS, (unsigned long)spurious_interrupt_bug },
+ { 15, 0, __KERNEL_CS, (unsigned long)fixup_4gb_segment },
{ 16, 0, __KERNEL_CS, (unsigned long)coprocessor_error },
{ 17, 0, __KERNEL_CS, (unsigned long)alignment_check },
#ifdef CONFIG_X86_MCE
extra-y += vmlinux.lds.s
-obj-y := ctrl_if.o evtchn.o process.o reboot.o xen_proc.o empty.o
+obj-y := ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o
--- /dev/null
+/******************************************************************************
+ * fixup.c
+ *
+ * Binary-rewriting of certain IA32 instructions, on notification by Xen.
+ * Used to avoid repeated slow emulation of common instructions used by the
+ * user-space TLS (Thread-Local Storage) libraries.
+ *
+ * Copyright (c) 2004, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/config.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+
+asmlinkage void do_fixup_4gb_segment(struct pt_regs *regs, long error_code)
+{
+}
/******************************************************************************
* arch/i386/traps.c
*
- * Modifications to Linux original are copyright (c) 2002-2003, K A Fraser
+ * Modifications to Linux original are copyright (c) 2002-2004, K A Fraser
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
/*
- * xen/arch/i386/traps.c
- *
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Pentium III FXSR, SSE support
#define DO_ERROR_NOCODE(trapnr, str, name) \
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
{ \
-do_trap(trapnr, str, regs, error_code, 0); \
+ do_trap(trapnr, str, regs, error_code, 0); \
}
#define DO_ERROR(trapnr, str, name) \
asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
{ \
-do_trap(trapnr, str, regs, error_code, 1); \
+ do_trap(trapnr, str, regs, error_code, 1); \
}
DO_ERROR_NOCODE( 0, "divide error", divide_error)
- DO_ERROR_NOCODE( 4, "overflow", overflow)
- DO_ERROR_NOCODE( 5, "bounds", bounds)
- DO_ERROR_NOCODE( 6, "invalid operand", invalid_op)
- DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun)
- DO_ERROR(10, "invalid TSS", invalid_TSS)
- DO_ERROR(11, "segment not present", segment_not_present)
- DO_ERROR(12, "stack segment", stack_segment)
-/* Vector 15 reserved by Intel */
- DO_ERROR_NOCODE(16, "fpu error", coprocessor_error)
- DO_ERROR(17, "alignment check", alignment_check)
- DO_ERROR_NOCODE(18, "machine check", machine_check)
- DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
-
- asmlinkage void do_int3(struct pt_regs *regs, long error_code)
+DO_ERROR_NOCODE( 4, "overflow", overflow)
+DO_ERROR_NOCODE( 5, "bounds", bounds)
+DO_ERROR_NOCODE( 6, "invalid operand", invalid_op)
+DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun)
+DO_ERROR(10, "invalid TSS", invalid_TSS)
+DO_ERROR(11, "segment not present", segment_not_present)
+DO_ERROR(12, "stack segment", stack_segment)
+DO_ERROR_NOCODE(16, "fpu error", coprocessor_error)
+DO_ERROR(17, "alignment check", alignment_check)
+DO_ERROR_NOCODE(18, "machine check", machine_check)
+DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
+
+asmlinkage void do_int3(struct pt_regs *regs, long error_code)
{
struct domain *p = current;
struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
/* Success! */
perfc_incrc(emulations);
regs->eip += pb - eip;
+
+ /* If requested, give a callback on otherwise unused vector 15. */
+ if ( VM_ASSIST(d, VMASST_TYPE_4gb_segments_notify) )
+ {
+ ti = &d->thread.traps[15];
+ gtb = &guest_trap_bounce[d->processor];
+ gtb->flags = GTBF_TRAP;
+ gtb->error_code = pb - eip;
+ gtb->cs = ti->cs;
+ gtb->eip = ti->address;
+ if ( TI_GET_IF(ti) )
+ d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
+ }
+
return 1;
undecodeable:
#define VMASST_CMD_enable 0
#define VMASST_CMD_disable 1
#define VMASST_TYPE_4gb_segments 0
-#define VMASST_TYPE_writeable_pagetables 1
+#define VMASST_TYPE_4gb_segments_notify 1
+#define VMASST_TYPE_writeable_pagetables 2
#ifndef __ASSEMBLY__